<?php

namespace App\Http\Controllers;

use App\Models\Video;
use App\Services\CollectService;
use Illuminate\Http\Request;

class TestController extends Controller
{
    //

    public function test(CollectService $collectService)
    {
//        $collectService->categoty();
        $data = Video::get()->toarray();
        foreach ($data as $value){
            echo '<a href="http://91.com/detail/'.$value['id'].'"><img src="'.$value['img'].'">'.'<br></a>';
        }
    }

    public function detail(Request $request){
        $data = Video::where(['id'=>$request->id])->first();
        return view('detail',['data'=>$data]);
    }
}
